'''
$LastChangedBy: csgillespie $
$LastChangedDate: 2007-06-06 11:08:06 +0000 (Wed, 06 Jun 2007) $
Some basic unittesting
'''
import unittest
import os, sys
DIR = '/data/ncsg3/svn/pythonR/BasisTools/trunk/'
sys.path.insert(0, DIR)
from pysbml import pysbml

class TestVisualise(unittest.TestCase):
	'''Tests the visualisation stuff'''
	def setUp(self):
		'''Make a list of the SBML files available'''
		self.sbml_files = []
		test_dir = DIR + '/test/'
		for file in os.listdir(test_dir):
			if file[-4:] == '.xml':
				self.sbml_files.append(test_dir + file)
	
	def testVisualiseModel(self):                                        
		'''Test the visualisation of models'''
		for file in self.sbml_files:
			sbml = pysbml(sbml_file = file)
			sbml.visualiseModel().static('jpg')

	def testVisualiseReactions(self): 
		'''Test the visualisation of models'''
		for file in self.sbml_files:
			sbml = pysbml(sbml_file = file)
			sbml.visualiseReaction(1).static('gif')

	def testVisualiseSpecies(self):
		'''Test the visualisation of species'''
		for file in self.sbml_files:
			sbml = pysbml(sbml_file = file)
			sbml.visualiseSpecies(2).static('png')
		
		
		
		
		
if __name__ == '__main__':
    unittest.main()
